#include "./../Include/public.h"
void del_stu()
{
	printf("输入要删除学生的学号：\n");
	char sno[12];
	scanf("%s",sno);
	
	FILE *f;
 	f = fopen("./data/log.log", "a+");
       time_t now ;
       struct tm *tm_now ;
       time(&now) ;
       tm_now = localtime(&now) ;
  		fprintf(f,"datetime: %d-%d-%d %d:%d:%d\n",tm_now->tm_year+1900, tm_now->tm_mon+1, tm_now->tm_mday, tm_now->tm_hour, tm_now->tm_min, tm_now->tm_sec) ;
  	fprintf(f, "delete student: %s\n",sno);
  	fclose(f);
	
	struct stu* p = head_stu;
	struct stu* q = p;
	while (p != NULL) {
		if(!strcmp(p->sno,sno)){
			if(p == head_stu) head_stu = head_stu->next;
			else	q->next = p->next;
			return;	
		}
		q = p;
		p = p->next;
	}
	printf("该学生不存在!\n");
	
}
